Compliance monitoring with electronic device